/*
 * @Author: duchengdong
 * @Date: 2021-10-18 11:21:14
 * @LastEditors: duchengdong
 * @LastEditTime: 2021-12-29 09:55:50
 * @Description:
 */
import {FC, useEffect} from 'react'
import ButtonBox from '../components/ButtonBox'
import useStoreHooks from 'hooks/useStoreHooks'

type PropTypes = {}

const Home: FC<PropTypes> = props => {
	console.log(props)
    const [state, actions, dispatch] = useStoreHooks('globle')
    let userInfo = state.userInfo
	useEffect(() => {
		console.log('store')
	}, [])
    console.log(userInfo)
	const click = () => {
		dispatch(actions.saveUserInfo({name: '李四', userId: '111111'}))
	}
	return (
		<div>
			<h1 className='required'>这是主页{userInfo.name}</h1>
			<ButtonBox btnTxt={'确定'} styleName="gray" btnFunc={click} />
		</div>
	)
}

export default Home
